namespace CSharpPro._0923;

public class Demo
{
    public void TestPrint1()
    {
        int num = 200;
        bool flag = (num % 4 == 0 && num % 100 != 0) || num % 400 == 0;
    }
//旅游价格计算
    public static double TestPrint2(int month,String transport)
    {
        double originalPrice = 8800;
        double discount = 1;

        // 判断季节和交通方式，设置折扣
        if (month >= 5 && month <= 10) // 旺季
        {
            if (transport == "航班")
            {
                discount = 0.9;
            }
            else if (transport == "动车")
            {
                discount = 0.75;
            }
            else
            {
                Console.WriteLine("交通方式输入错误！");
                return -1; // 返回一个错误标志
            }
        }
        else //  淡季
        {
            if (transport == "航班")
            {
                discount = 0.6;
            }
            else if (transport == "动车")
            {
                discount = 0.3;
            }
            else
            {
                Console.WriteLine("交通方式输入错误！");
                return -1; // 返回一个错误标志
            }
        }
        return originalPrice * discount;
    }
}